package middle;

import java.util.HashMap;
import java.util.Map;
import java.util.TreeSet;

public class Solution_220 {

    public boolean containsNearbyAlmostDuplicate(int[] nums, int k, int t) {
        return false;
    }

    public boolean containsNearbyAlmostDuplicate1(int[] nums, int k, int t) {
        for (int i = 1; i < nums.length; i++) {
            for (int j = Math.max(i - k, 0); j < i; j++) {
                long abs = Math.abs((long) nums[i] - (long) nums[j]);
                if (abs <= t) {
                    return true;
                }
            }
        }
        return false;
    }

    public static void main(String[] args) {
        Solution_220 model = new Solution_220();
        System.out.println(model.containsNearbyAlmostDuplicate(new int[]{1, 2, 3, 1}, 3, 0));
        System.out.println(model.containsNearbyAlmostDuplicate(new int[]{1, 2, 2, 3, 4, 5}, 3, 0));
    }
}
